home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 3_16.lha / 3_16 / 3_16b.c < prev    next >
Text File  |  1993-08-08  |  358b  |  20 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. * handle a line comment */
  6. oid dolinecomment()
  7.  
  8.    char ch;
  9.  
  10.    // loop until end of line
  11.    while (cin.get(ch))
  12. if (ch == '\n')
  13.     {
  14.     cout.put(ch);
  15.    return;
  16.     }
  17.  
  18.    error("EOF found within line comment");
  19.  
  20.